Make the Linux test suite pass, and run it in CI - #48
Merged
Conversation
The promotion tests now skip when the environment cannot do real-time scheduling on both Linux builds; previously only the native (no-dbus) build had the guard, so machines without a usable rtkit-daemon failed every test. The guard prints the underlying error when it skips, which distinguishes a missing daemon from an exhausted request budget. rtkit-daemon grants at most --actions-per-burst-max (default 25) requests per --actions-burst-sec (default 20 seconds) window per user, and the suite issued 168 promotion requests by construction, so a cold cargo test run could never pass against a stock daemon. The tests now hold a shared lock, probe once per test, and the concurrency test promotes once per thread across four threads on Linux (the other platforms have no budget and keep 32 threads), which measures 16 requests per run including the doctest. The budget is shared with the whole desktop session, so leave about twenty seconds between consecutive runs. Checks that need no real-time permission, argument validation and the thread-info serialization round trips, moved above the guards so they run everywhere, including CI. CI now runs the test step on Linux too, with --nocapture so the skip notices are visible. The runners do have rtkit installed, pulled in by pulseaudio, but its polkit policy only serves processes in an active session, so the promotion tests skip themselves there.
zang3tsu
force-pushed
the
fix-linux-tests
branch
from
August 10, 2026 07:13
4cc52a7 to
e30c6c7
Compare
padenot
approved these changes
Aug 10, 2026
padenot
left a comment
Contributor
There was a problem hiding this comment.
Good catch, thanks a lot.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to the discussion in #47.
The Linux/dbus test suite could never pass:
--actions-per-burst-max/--actions-burst-sec), so a coldcargo testalways hit "Device or resource busy" partway through. CI never caught either, because the Linux test step was disabled.Changes:
rt_scheduling_availableskip-guard now covers both Linux builds and all four tests, and prints the underlying error when it skips, so a missing daemon and an exhausted budget are distinguishable.--nocaptureso the skip notices are visible in the log. The runners do have rtkit installed (pulled in by pulseaudio's Recommends), but its polkit policy only serves processes in an active session, which a runner job is not — so the promotion tests skip themselves there while the permission-free checks run.Verified on Arch Linux (rtkit 0.14): cold
cargo testpasses repeatedly with 25s spacing, exercising real promotions (16/25 requests measured in the rtkit journal); with rtkit-daemon masked, the suite passes via skips (the CI scenario).Noticed while auditing, out of scope here: in
rt_linux.rsthe demotion paths testpthread_setschedparam(...) < 0, but pthread functions return 0 or a positive errno, so demotion failures on the dbus build are silently reported as success (rt_linux_native.rsgets this right with!= 0).